import { Controller, Get, Query, Req } from '@nestjs/common';
import { successReturn } from 'src/util';
import { ChargeOrderService } from './charge-order.service';

@Controller('chargeOrder')
export class ChargeOrderController {
    constructor(
        private chargeOrderService:ChargeOrderService
    ){}

    @Get('charging')
    async charging(@Req() { userId }) {
        let orderList = await this.chargeOrderService.charging(userId)
        return successReturn(orderList)
    }

    @Get('page')
    async page(@Query() query:Pagination, @Req() { userId }) {
        let rows = await this.chargeOrderService.page(query, userId)
        return successReturn(rows)
    }
}
